<div class="module-trade">
    <ol class="breadcrumb fn-clearfix">
        <li>交易管理</li>
        <li>交易查询</li>
    </ol>
    <div class="panel panel-warning">
        <div class="panel-body">
            <form class="form-inline ui-form" role="form">
                <div class="form-group ui-input-select">
                    <label for="record-uid" class="control-label f-12">买家UID：</label>
                    <input type="text" class="form-control " placeholder="UID" ng-model="buyUid" id="record-uid">
                </div>
                <div class="form-group ui-input-select">
                    <label for="record-uid" class="control-label f-12">卖家UID：</label>
                    <input type="text" class="form-control " placeholder="UID" ng-model="sellUid" id="record-uid">
                </div>
                <div class="form-group ui-input-select">
                    <label for="record-tid" class="control-label f-12">订单ID：</label>
                    <input type="text" class="form-control " placeholder="订单id" ng-model="tid" id="record-tid">
                </div>
                <div class="form-group ui-input-select">
                    <label for="symbol-type" class="control-label f-12">交易币种：</label>
                    <select class="form-control" ng-model="vm.condition.assetCode" ng-change="vm.changeSymbol()" id="symbol-type">
                        <option value="{{symbol.value}}" ng-repeat="symbol in symbolList">{{symbol.label}}</option>
                    </select>
                </div>
                <br />
                <div class="form-group ui-input-select">
                    <label for="symbol-type" class="control-label f-12">订单状态：</label>
                    <select class="form-control" ng-model="vm.condition.status" id="symbol-type">
                        <option value="{{status.value}}" ng-repeat="status in statusList">{{status.label}}</option>
                    </select>
                </div>
                <div class="form-group">
                    <label class="control-label f-12">日期：</label>
                    <input type="date" ng-model="beginTime" class="form-control w180" ng-change="vm.changeStartDate(beginTime)">
                    -
                    <input type="date" ng-model="endTime" class="form-control w180" ng-change="vm.changeEndDate(endTime)"
                        ng-disabled="disabledEndDate" min="{{min}}">
                </div>
                <!-- <div class="form-group ui-input-select">
                    <label for="record-email" class="control-label f-12">邮箱：</label>
                    <input type="text" class="form-control " placeholder="请输入email" ng-model="email" id="record-email">
                </div> -->
                <div class="form-group">
                    <button type="submit" class="btn btn-primary" ng-click="vm.fetchList()">搜索</button>
                </div>


            </form>
        </div>
    </div>

    <div class="ui-box">
        <div class="info-box">
            <span class="info-label">成交总数量：</span>
            <span class="info-text">{{vm.totalInfo.number}}</span>
            <span class="info-label">成交总金额：</span>
            <span class="info-text">{{vm.totalInfo.amount}}</span>
        </div>
        <table class="table table-striped table-hover table-bordered">
            <thead>
                <tr>
                    <th>交易订单号</th>
                    <th>卖家卖单号</th>
                    <th>订单创建时间</th>
                    <th>订单完成时间</th>
                    <th>交易币种</th>
                    <th>成交数量</th>
                    <th>成交价格</th>
                    <th>成交金额</th>
                    <th>锁定金额</th>
                    <th>手续费</th>
                    <th>买方</th>
                    <th>卖方</th>
                    <th>所属区域</th>
                    <th>订单状态</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="item in vm.list" ng-if="vm.isLoading === false && vm.list.length > 0">
                    <td>{{item.transOrderId}}</td>
                    <td>{{item.advertId}}</td>
                    <td>{{$root.moment(item.createDate - 0).utc().utcOffset($root.ZONE).format('YYYY-MM-DD HH:mm:ss')}}</td>
                    <td>{{$root.moment(item.updateDate - 0).utc().utcOffset($root.ZONE).format('YYYY-MM-DD HH:mm:ss')}}</td>
                    <td>{{item.assetCode}}</td>
                    <td>{{item.number}}</td>
                    <td>{{item.tradePrice}}</td>
                    <td>{{item.money}}</td>
                    <td>{{item.lockNum}}</td>
                    <td>{{item.fee}}</td>
                    <td>{{item.buyUid}}</td>
                    <td>{{item.sellUid}}</td>
                    <td>{{item.c2cTransOrderType == 'SELL' ? '售卖区' : '收购区'}}</td>
                    <td ng-class="{
                        graytradedetail:(item.status=='CANCELED'|| item.status=='CLOSED'  || item.status == 'OVERTIME'),
                        greentradedetail:(item.status=='FINISHED' || item.status=='PAID'),
                        redtradedetail:(item.status=='COMPLAINNING'),
                        orangetradedetail:(item.status=='UNPAY')}">
                        {{vm.statusFun(item.status)}}
                    </td>
                </tr>
                <tr class="ui-no-data" ng-if="vm.isLoading === false && (vm.list.length === 0||vm.list===null)">
                    <td colspan="13">暂无数据</td>
                </tr>
                <tr class="ui-loading" ng-if="vm.isLoading === true">
                    <td colspan="13">正在加载，请稍候...</td>
                </tr>
            </tbody>
        </table>

        <div class="ui-pager-box" ng-if="vm.totalNum > 0">
            <ul uib-pagination previous-text="上一页" next-text="下一页" first-text="首页" last-text="尾页" total-items="vm.totalNum"
                ng-model="vm.condition.pageNo" max-size="5" items-per-page="vm.pageSize || 10" align="right" class="pagination"
                boundary-links="true" ng-change="vm.pageChanged()" rotate="false"></ul>
        </div>
    </div>
</div>